[Statedef -2]

[State 0, VarSet]
type = VarSet
trigger1 = NumPartner && (ID = 57 || ID = 59)
trigger2 = !AILevel
trigger3 = AILevel && enemy,Name = "Bonus"
var(5) = 1

[State -2, Character Detection]
type = VarSet
trigger1 = enemynear,AuthorName = "FAMFIGHT"
var(1) = 1

[State -2, AssertSpecial]
type = AssertSpecial
trigger1 = 1
flag = nostandguard
flag2 = nocrouchguard
flag3 = noairguard

[State -2, AssertSpecial]
type = AssertSpecial
trigger1 = 1
flag = nowalk
flag2 = timerfreeze
flag3 = nokosnd

[State -2, StopSnd]
type = StopSnd
trigger1 = RoundState = 2
channel = 1

[State -2, StopSnd]
type = StopSnd
trigger1 = RoundState = 2
channel = 2

[State -2, No Music When Dead]
type = AssertSpecial
trigger1 = (MatchOver) && !alive
trigger2 = RoundState = 3 
trigger3 = LoseTime || WinTime || DrawGame
flag = nomusic

[State 0, ChangeState]
type = ChangeState
trigger1 = (MoveType = H || enemy,Life <= 1) && StateNo != 5150
value = 5150

[State 0, VarSet]
type = VarSet
trigger1 = 1
var(0) = Var(4) = 0

[State 0, VarSet]
type = VarSet
trigger1 = 1
var(3) = Cond(NumHelper(1),helper(1),Var(1),0)
ignorehitpause = 1

[State 0, VarSet]
type = VarSet
trigger1 = 1
var(4) = Cond(NumHelper(1),helper(1),Var(2),0)
ignorehitpause = 1

[State 0, CtrlSet]
type = CtrlSet
trigger1 = 1
value = 0

[State 0, ChangeState]
type = ChangeState
trigger1 = !IsHelper && (StateNo = [10,19])
value = 1

[State 0, Helper]
type = Helper
trigger1 = StateNo = 5150 && RoundState = 4 && !NumHelper(180)
name = "Poison"
ID = 180
stateno = 8
pos = 50,0
postype = right
facing = 1
keyctrl = 0
ownpal = 0


;-------------------------------------------------
[State -2, Debug]
type = DisplaytoClipboard
trigger1 = 1
text = "Vel: x = %f y = %f Mario by GDKN + KingPepe. \nPos: x = %f y = %f Version: FamFight TestVar: = %d"
params = fvar(20),fvar(21),fvar(22),fvar(23),Cond(NumHelper(1),(helper(1),Var(1)),0)
ignorehitpause = 1

[State -2, Vel X]
type = VarSet
trigger1 = 1
fvar(20) = Vel X

[State -2, Vel Y]
type = VarSet
trigger1 = 1
fvar(21) = Vel Y

[State -2, Pos X]
type = VarSet
trigger1 = 1
fvar(22) = Pos X

[State -2, Pos Y]
type = VarSet
trigger1 = 1
fvar(23) = Pos Y

[State -2, TestVar]
type = VarSet
trigger1 = Numhelper(10)
var(24) = helper(10),Var(0)

;-------------------------------------------------
[State -2, Helper Menu]
type = Helper
triggerall = var(1) && (StateNo = [190,194]) && (AILevel != 0 && enemy,Name != "Bonus")
triggerall = (RoundNo = 1) && (!NumHelper(850))
trigger1 = RoundState < 2
helpertype = normal 
name = "Intro Message"
ID = 850
stateno = 850
pos = 0,0
postype = back
facing = 1
keyctrl = 1
ownpal = 1
supermovetime = 9999
pausemovetime = 9999

[State -2, Helper Menu]
type = Helper
triggerall = var(1) && (StateNo = [190,194]) && (AILevel = 0 || (AILevel && enemy,Name = "Bonus"))
triggerall = (RoundNo = 1) && (!NumHelper(850))
trigger1 = RoundState < 2
helpertype = normal 
name = "Unavailable Helper Menu"
ID = 850
stateno = 853
pos = 0,0
postype = back
facing = 1
keyctrl = 1
ownpal = 1
supermovetime = 9999
pausemovetime = 9999


[State -2, Helper Menu]
type = Helper
triggerall = var(1)
triggerall = (!NumHelper(860))
trigger1 = RoundState < 2 && (RoundNo >= 2)
trigger2 = NumPartner && (StateNo = 191) && !Time
helpertype = normal 
name = "Intro"
ID = 860
stateno = 860
pos = 0,0
postype = back
facing = 1
keyctrl = 1
ownpal = 1
supermovetime = 9999
pausemovetime = 9999

[State -2, Helper Menu]
type = Helper
triggerall = !NumHelper(870) && TeamSide = 2 && !Var(5)
trigger1 = RoundState = 2
helpertype = normal 
name = "HUD"
ID = 870
stateno = 870
pos = 0,0
postype = back
facing = 1
keyctrl = 1
ownpal = 1
supermovetime = 9999
pausemovetime = 9999
;-------------------------------------------------
[State -2, Intro Countdown]
type = VarAdd
triggerall = RoundState = 1 && StateNo = 0 && enemy, StateNo = 0
trigger1 = Var(32) > 0
var(32) = -1

[State -2, AssertSpecial]
type = AssertSpecial
trigger1 = Var(32) > 0
flag = intro

[State -2, VarSet]
type = VarSet
trigger1 = RoundState = 2
var(32) = 0
; ---------------------------------------------------------
;   ----- Uno Tag System v.2.5 STATEDEF -2 Override -----
; ---------------------------------------------------------
;
; Uno Tag System ver.2.5 by UnoShe
; - PLEASE GIVE CREDIT IF MODIFYING THIS..
;
[State -2, deactivate tag]
type = VarSet
triggerall = Numpartner
triggerall = var(51) > 0
triggerall = var(51) != 6
trigger1 = roundstate > 2
trigger1 = Win || Lose
trigger2 = Roundstate < 1
;trigger2 = teammode = Simul
trigger2 = !partner, var(51)
trigger2 = Time = [1,2]
trigger3 = Numpartner
trigger3 = Partner, var(51)
trigger3 = !Life
v = 51
value = 0

[State -2, def_partner]
type = VarSet
triggerall = Numpartner
trigger1 = roundstate < 1
trigger1 = time = [0,1]
v = 51
value = (1 + ((ID > Partner, ID)*4))

; Tag active definer
[State -2, def]
type = VarSet
triggerall = NumPartner
trigger1 = var(51) = 8
trigger1 = !(Partner, Life)
trigger2 = (Partner, StateNo = [4910,4912]) || Partner, StateNo = 4914
trigger2 = var(51) != [2,9] 
trigger3 = var(51) = 5
trigger3 = Roundstate = 2
trigger3 = Stateno = [4911,4912]
trigger4 = (Partner, StateNo != [4910,4912]) || Partner, StateNo = 4914
trigger4 = Var(51) = 10 || Var(51) = 11 
v = 51
value = 1

[State -2, Uno]
type = ParentVarSet
trigger1 = PrevStateNo = 4906
v = 51
value = 7

[State -2, Angat!] 
type = Null
triggerall = NumTarget
triggerall = NumPartner
triggerall = var(51) = 8
triggerall = stateno != [4901,4933]
triggerall = prevstateno = 4933
trigger1 = target, Statetype != S
trigger1 = Target, HitVel Y < 2
trigger1 = MoveHit || (NumProj > 0 && ProjHit = 1, < 30)
trigger1 = Target, Pos Y > -50
trigger1 = !(Target, StateNo >= 5050)
trigger2 = Target, Hitfall
trigger2 = MoveHit || (NumProj > 0 && ProjHit = 1, < 30)
trigger2 = Target, Pos Y > -50
trigger2 = !(Target, StateNo >= 5050)
x = -0.1
y = -8
persistent = 0

[State -2, Eksena]
type = ScreenBound
triggerall = NumPartner
trigger1 = Partner, var(51) = 4
trigger1 = stateno = 4931 || prevstateno = 4931
value = 1
movecamera = 1,1

[State -2, def]
type = VarSet
triggerall = NumPartner
trigger1 = partner, time = [0,1]
trigger1 = Partner, Stateno = 4904
trigger2 = partner, time = [0,1]
trigger2 = Partner, Stateno = 4910
trigger2 = StateNo != [4901,4928]
v = 51
value = 1

[State -2, GTG]
type = SelfState
triggerall = NumPartner
trigger1 = Life && Partner, Life
trigger1 = PrevStateno = 4926
trigger1 = stateno != 4911
value = 4911
ignorehitpause = 1

[State -2, Oh No!]
type = SelfState
trigger1 = prevstateno = 4912 || prevstateno = 4914
trigger1 = !(stateno = [4901,4933])
value = 4912
ctrl = 0

[State -2, PowerReset]
type = poweradd
trigger1 = var(51) = 5
trigger1 = RoundNo < 2
trigger1 = RoundState < 2
trigger1 = time = 0
value = -Power
persistent = 0

[State -2, PowerAdd]
type = Null
trigger1 = var(51) = 5 && power < 900
trigger1 = RoundNo < 2
trigger1 = RoundState < 2
trigger1 = time = 1
value = 1000
persistent = 0

; Tag active ctrl
[State -2, ctrl]
type = SelfState
triggerall = Numpartner
trigger1 = Partner, var(51)
trigger1 = !Var(51)
trigger1 = var(51) != 8 && Partner,var(51) != 8
trigger1 = StateNo != 5900
trigger1 = partner, var(51) != [2,8]
trigger1 = RoundState = 2
trigger1 = Life && Partner, Life
trigger1 = stateno != [1000,4999]
value = 4912
ctrl = 0
